/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package csse3004.GD;

import java.util.ArrayList;

/**
 *
 * @author Tom McNair - S41758984
 */
public class MCAnswer  {

    private int id;
    private String text;
    private boolean correct;
    private int weighting;
    private int qid;

    public int getQid() {
        return qid;
    }

    public void setQid(int qid) {
        this.qid = qid;
    }
    
    public boolean isCorrect() {
        return correct;
    }

    public void setCorrect(boolean correct) {
        this.correct = correct;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String type) {
        this.text = type;
    }

    public int getWeighting() {
        return weighting;
    }

    public void setWeighting(int weighting) {
        this.weighting = weighting;
    }
    
    /**
     * Will generate two questions that cover both the unanswered and the answered types
     * this i belive is all states a question could be in
     * @param qid This will form part of the answer test (ie seed =2, 
     *      answer.text = "Test Answer 2" It will also set the ID
     * @return an array of Answers with different texts based on that seed
     */
    public ArrayList<MCAnswer> genTest(int qid) {
        ArrayList<MCAnswer> ans = new ArrayList<MCAnswer>();
        for (int i = 0; i < 10; i++) {
            ans.add(new MCAnswer());
            ans.get(i).setText("Test Answer " + qid);
            ans.get(i).setId(qid++);
            if (i%2==0) { 
                ans.get(i).isCorrect();
            }
        }
        return ans;
    }
}
